<?php 
	session_start();
?>
<!--?xml version="1.0"?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs"><head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="cs" />
    <meta name="robots" content="all,follow" />

    <meta name="author" content="All: ... [Nazev webu - www.url.cz]; e-mail: info@url.cz" />
    <meta name="copyright" content="Design/Code: Vit Dlouhy [Nuvio - www.nuvio.cz]; e-mail: vit.dlouhy@nuvio.cz" />
    
    <title>ASODECO - Asociaci&oacute;n para el Desarrollo de la Educaci&oacute;n Complementaria - Encuestas.</title>
    <meta name="description" content="..." />
    <meta name="keywords" content="..." />
    <script src="lib/jquery.js" type="text/javascript" language="javascript"></script>
    <link rel="index" href="./" title="Home" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="./resources/css/main.css" />
    <link rel="stylesheet" media="print" type="text/css" href="./resources/css/print.css" />
    <link rel="stylesheet" media="aural" type="text/css" href="./resources/css/aural.css" />
	<script language="javascript">
		
		var nav = (document.layers) ? true : false
		
		function changeOn(Boton){
			if (!nav && Boton) Boton.src="resources/design/buttonOn.gif" //modificamos el color
		}

		function changeClick(Boton){
			if (!nav && Boton) Boton.src="resources/design/buttonOn.gif" //modificamos el color
		}
		
		function changeOff(Boton){
			if (!nav && Boton) Boton.src="resources/design/button.gif" //modificamos el color
		}
		
		// funciones equivalentes al trim
		function ltrim(s) {
		   return s.replace(/^\s+/, "");
		}
		
		function rtrim(s) {
		   return s.replace(/\s+$/, "");
		}
		
		function trim(s) {
		   return rtrim(ltrim(s));
		}
	
		$(document).ready(function()
		{
			$("#login_form").submit(function()
			{
				//if ( (trim($('#username').val())).length == 0 || (trim($('#password').val())).length == 0) { 
				//}else {					
					//remove all the class add the messagebox classes and start fading
					$("#msgbox").removeClass().addClass('messagebox').text('Validando login...').fadeIn(1000);
					//check the username exists or not from ajax
					$.post("pages/controllers/ajax_login.php",{ user_name:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,
					function(data)
					{
					  if(data=='yes') //if correct login detail
					  {
						$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
						{ 
						  //add message and change the class of the box and start fading
						  $(this).html('Login aceptado').addClass('messageboxok').fadeTo(900,1,
						  function()
						  { 
							 //redirect to secure page
							 document.location='index.php';
						  });
						  
						});
					  }
					  else 
					  {
						$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
						{ 
						  //add message and change the class of the box and start fading
						  $(this).html('Login denegado').addClass('messageboxerror').fadeTo(900,1);
						});		
					  }
							
					});
					return false; //not to post the  form physically 
				//}
			});
		});
</script>


<!-- Desabilita el boton derecho del mouse -->
<script language="JavaScript">
   var message = "";

   function clickIE(){
    if (document.all){
     (message);
     return false;
    }
   }

   function clickNS(e){
    if (document.layers || (document.getElementById && !document.all)){
     if (e.which == 2 || e.which == 3){
      (message);
      return false;
     }
    }
   }

   if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = clickNS;
   } else {
    document.onmouseup = clickNS;
    document.oncontextmenu = clickIE;
   }
   document.oncontextmenu = new Function("return false")
  </script> 
  


<style type="text/css">

.buttondiv {
margin-top: 10px;
}
.messagebox{
	position:absolute;
	width:110px;
	margin-left:30px;
	border:1px solid #c93;
	background:#ffc;
	padding:2px;
}
.messageboxok{
	position:absolute;
	width:110;
	margin-left:30px;
	border:1px solid #349534;
	background:#C9FFCA;
	padding:2px;
	font-weight:bold;
	color:#008000;
	
}
.messageboxerror{
	position:absolute;
	width:110;
	margin-left:30px;
	border:1px solid #CC0000;
	background:#F7CBCA;
	padding:2px;
	font-weight:bold;
	color:#CC0000;
}

</style>

</head>


<!-- Main -->
<div id="main" class="box">

    <!-- Header -->
    <div id="header">

        <!-- Logotyp -->
        <h1 id="logo"><!a href="./" title="Crystal X [Go to homepage]">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>ASODECO </strong><span></span><!/a></h1>
        <hr class="noscreen" />          

        <!-- Quick links -->
        <div class="noscreen noprint">
            <p><em>Quick links: <a href="#content">content</a>, <a href="#tabs">navigation</a>, <a href="#search">search</a>.</em></p>
            <hr />
        </div>
  </div> <!-- /header -->

	<!--menu de opciones del index -->
	<?php 
	if (isset($_SESSION['login'])) { ?>
    
    <!-- Main menu (tabs) -->
     <div id="tabs" class="noprint">
            <h3 class="noscreen">Navigation</h3>
            <ul class="box">
                <li id="active"><a href="index.php">Inicio<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="pages/views/empresas.php">Empresas<span class="tab-l"></span><span class="tab-r"></span></a></li> 
                <li><a href="pages/views/instrumentos.php">Instrumentos<span class="tab-l"></span><span class="tab-r"></span></a></li>                <li><a href="pages/views/aplicaciones.php">Aplicaciones<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="pages/views/resultados.php">Resultados<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="pages/views/usuarios.php">Usuarios<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li ><a href="pages/views/config.php">Configuración<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="pages/views/sync.php">Sincronizar<span class="tab-l"></span><span class="tab-r"></span></a></li>
            </ul>
        <hr class="noscreen" />
     </div> <!-- /tabs -->
     
	<?php } ?><!--/menu -->
	
<!-- Page (2 columns) -->
    <div id="page" class="box">
    <div id="page-in" class="box">



        <!-- Content -->
        <div id="content">

            <!-- Article -->
            <div class="article">
                <h2><span>Bienvenido</span></h2>

           <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ASODECO tiene como prop&oacute;sito fundamental, la b&uacute;squeda constante del mejoramiento de la calidad de vida de las personas con discapacidad, a trav&eacute;s de la integraci&oacute;n laboral como medio de dignificaci&oacute;n y crecimiento del ser humano. 
				<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Para alcanzar este fin, ASODECO cuenta con la participaci&oacute;n activa de la familia, las empresas, la comunidad y de profesionales altamente calificados, que colaboran respondiendo la presente encuesta, para mejorar el dise&ntilde;o, implementaci&oacute;n y evaluaci&oacute;n de programas que garanticen una formaci&oacute;n integral y una efectiva integraci&oacute;n socio-laboral.</p><br/>

	        <img src="resources/design/im1.jpg" alt="" align="middle" />
          </div> <!-- /article -->

            <hr class="noscreen" />
            
        </div> <!-- /content -->
        <!-- Right column -->
        <div id="col" class="noprint">
            <div id="col-in">


                <!-- About Me -->
			<?php 
				if (!isset($_SESSION['login'])) { ?>
                    
            <h3><span>Sesi&oacute;n de Usuario</a></span></h3>
                <div id="about-me">
                    <div class="buttondiv"  align="justify"><span id="msgbox" style="display:none"></span></div>
            <form method="post" action="" id="login_form">
				<fieldset>            
                    <label> Nombre de usuario</label><input name="username" type="text" id="username" value="" maxlength="20" />
                    <label> Contrase&ntilde;a</label><input name="password" type="password" id="password" value="" maxlength="20" />
                    <div class="buttondiv">
                    <input align="left" class="button" type="image" src="resources/design/button.gif"  onmouseover="changeOn(this);" onMouseOut="changeOff(this);"  onclick="changeClick(this);" name="btnLogin" />  
                    </div>

				</fieldset>           
            </form>
				<p align="left">&nbsp;&nbsp;<a href="pages/views/recuperar.php">Olvid&oacute; su clave?</a></p>                            
                </div> <!-- /about-me -->
			<?php }else { ?>

                <h3><span>Acerca de M&iacute;</span></h3>
                <div id="about-me">
                    <strong><?php echo $_SESSION['user_name'] ?></strong><br />
                    <?php echo $_SESSION['user_email'] ?><br />
                    Caracas, VEN<br /><br />
                    <a href="pages/controllers/logout.php">Cerrar Sesi&oacute;n</a></p>
                </div> <!-- /about-me -->
                
			 <?php } ?>
                <hr class="noscreen" />

                <!-- Links -->
                <h3><span>Enlaces de Inter&eacute;s</span></h3>

          <ul id="links">
                    <li><a href="http://www.asodeco.org/">ASODECO</a></li>
                    <li><a href="http://www.avesid.org/">AVESID</a></li>
                    <li><a href="http://www.webmediaven.com/avepane/">AVEPANE</a></li>
                    <li><a href="http://www.apoye.org.ve/">APOYE</a></li>
                    <li><a href="http://www.pasoapaso.com.ve/CMS/">FUND. PASO A PASO</a></li>
                </ul>

                <hr class="noscreen" />
            
            </div> <!-- /col-in -->
        </div> <!-- /col -->

    </div> <!-- /page-in -->
    </div> <!-- /page -->

    <!-- Footer -->
    <div id="footer">
        <div id="top" class="noprint"><p><span class="noscreen">Back on top</span> <a href="#header" title="Back on top ^">^<span></span></a></p></div>
        <hr class="noscreen" />
        
        <p id="createdby">creado por <a href="http://www.asodeco.org">PSC Asodeco</a> <!-- DON´T REMOVE, PLEASE! --></p>
        <p id="copyright">&copy; 2010 <a href="mailto:contacto@asodeco.org">Asodeco</a></p>
    </div> <!-- /footer -->

</div> <!-- /main -->

</body>
</html>
